home *** CD-ROM | disk | FTP | other *** search
/ Tech Arsenal 1 / Tech Arsenal (Arsenal Computer).ISO / tek-06 / pmail235.zip / UDG.ZIP / UDG.TXT < prev   
Text File  |  1992-08-09  |  17KB  |  394 lines

  1. ┌────────────────────────────────────────────────────────────┐
  2. │                                                            │
  3. │    Pegasus Mail v2.3 user-defined gateway reference.       │
  4. │    This document is part of the Pegasus Mail manual set    │
  5. │    and is provided as a courtesy to users of Pegasus       │
  6. │    Mail.                                                   │
  7. │                                                            │
  8. │    (c) 1992, David Harris, All Rights Reserved.            │
  9. │                                                            │
  10. └────────────────────────────────────────────────────────────┘
  11.  
  12.  
  13. User-defined gateways
  14. ---------------------
  15.  
  16. Pegasus Mail version 2.25 and later incorporate a feature which 
  17. allows you to implement your own mail transport and have Pmail 
  18. use it. The intention is that you will provide the mechanism 
  19. for moving the messages and  attachments from place to place, 
  20. while Pmail does the preparation, formatting and filing for you.
  21.  
  22. Here are some possible gateways you could develop:
  23.  
  24. *    An implementation of uucp for dial-in Internet mail
  25.  
  26. *    A standalone gateway which communicates with a machine attached 
  27. to your LAN, allowing you access to all your LAN mail features 
  28. from a remote machine (such a gateway is currently under development 
  29. as part of the Pmail system).
  30.  
  31. *    A custom system which takes LAN mail and transfers it via some 
  32. file transfer protocol to a mainframe.
  33.  
  34. *    A gateway to a facsimile server.
  35.  
  36. The possibilities are limited only by your imagination.
  37.  
  38.  
  39. The gateway process.
  40. -------------------
  41.  
  42. While Pmail offers considerable flexibility in the way it can 
  43. interact with your gateway, be aware that creating a gateway 
  44. will almost certainly involve a small amount of programming - 
  45. typically, you will need to write the program which Pmail runs 
  46. to deliver and receive mail. You can do this programming in any 
  47. language which produces a program which could be run from DOS: 
  48. Pegasus Mail is written in C, but you could easily write your 
  49. gateway process in Pascal, Modula-II or even in Basic (God forbid!). 
  50. Pmail invokes your gateway process when sending mail, or to check 
  51. for new mail. In most cases, your gateway process must not write 
  52. to the screen.
  53.  
  54. Note: you can use MS-DOS batch files as gateway processes.
  55.  
  56. What the gateway process does, and how you should do it is not 
  57. covered in this manual - this is your part of the project, and 
  58. you'll have to design it to your own specification. As a help, 
  59. however, the last section of this document describes how we interfaced 
  60. Pmail with Waffle, a popular BBS and UUCP program.
  61.  
  62.  
  63. How Pmail uses a UDG
  64. --------------------
  65.  
  66. You have to provide Pmail with a set of instructions which it 
  67. uses to interface to your gateway. You do this using Pmail's 
  68. PCONFIG program, choosing "create a User-defined gateway". The 
  69. gateway definition screen is essentially a form - you merely 
  70. have to fill in the appropriate details for your gateway.
  71.  
  72.  
  73. Command substitution
  74. --------------------
  75.  
  76. Most of the entries in this screen which accept strings allow 
  77. you to use special command substitution characters in the strings: 
  78. these are like "escape sequences" which will cause Pmail to perform 
  79. some substitution at run-time. Command substitutions always begin 
  80. with a tilde (~) character, and are always two characters long. 
  81. The following command substitutions are recognised:
  82.  
  83.    This sequence...   Is replaced with this value
  84.  
  85.    ~c       The full path to the file containing the message
  86.    ~t       The address to which to send this message
  87.             (note: this is not necessarily the To: field)
  88.    ~s       The message's subject field
  89.    ~f       The full form of the message's "from" field
  90.    ~n       The sender's user name in its simplest form
  91.    ~b       The sender's bindery id, as a long hex integer
  92.    ~8       The first 8 chars in the sender's username
  93.    ~y       The time and date in RFC-822 format
  94.    ~d       A random integer, expressed as 4 hex digits
  95.    ~q       Y if this message is a BCC, N otherwise
  96.    ~%name%  The value of the environment variable %name%.
  97.    ~p       The user's personal name preference
  98.    ~x       The name.ext ONLY of the container file (no path)
  99.    ~~       A single tilde character.
  100.  
  101. Example: Assume that you have defined the gateway output command
  102.  
  103.    mygate ~c ~8 sys:mail/~b
  104.  
  105. And a user called DAVID, whose bindery ID is 4000001 sends a 
  106. message which Pmail stores in c:\temp\119944.tmp. When Pmail 
  107. invokes your gateway, the command line will be as follows:
  108.  
  109.       mygate c:\temp\119944.tmp DAVID sys:mail/4000001
  110.  
  111. In the following description of the Gateway Definition screen, 
  112. fields marked with an * will support command substitution. Command 
  113. substitution is also possible in the "Home mailbox" and "New 
  114. mailbox" fields of Pmail's standalone configuration screen.
  115.  
  116.  
  117. Gateway definition fields
  118. -------------------------
  119.  
  120. Gateway name:  This is the name by which users will know this 
  121. gateway. It should follow legal NetWare naming rules, and cannot 
  122. contain spaces.
  123.  
  124. Users will access the gateway using NetWare usercode syntax so, 
  125. say you call your gateway HONG_KONG, and a user wants to mail 
  126. to someone called J_JONES at the gateway, they would enter the 
  127. address as HONG_KONG/J_JONES.
  128.  
  129. *New mail path:  This is either a full path to a location where 
  130. Pmail is to find new mail, or else the name of a program to run 
  131. when checking for new mail. You can use command substitution 
  132. in this string to construct complex paths.  note that Pmail will 
  133. assume that ALL mail matching the search mask is for the current 
  134. user - it will not parse messages to determine the recipient. 
  135. If your transport places new mail in the mail directory each 
  136. user has in SYS:MAIL, using a .CNM file extension, then you do 
  137. not need to enter anything in this field. Note that if you have 
  138. a gateway which writes messages into the user's NetWare directory 
  139. in SYS:MAIL using an extension other than .CNM, you can enter 
  140. a search path here using this command substitution: SYS:MAIL/~b 
  141. (See the section on command substitutions for more on this).
  142.  
  143. Is ^ a program to run?  Enter 'Y' if "New mail path" is a program 
  144.  name rather than a directory name. Gateways which require a 
  145. program  to be run to retrieve new mail will not be polled periodically 
  146. - rather, the "check for New mail" option will remain permanently 
  147. on the main menu, and the program can only be run when that option 
  148. is selected.
  149.  
  150. *New mail search mask:  This is a DOS filename pattern which 
  151. Pmail is to use when searching the New mail path for new mail. 
  152. New mail messages will be rewritten in the user's home mailbox 
  153. using the normal Pmail naming convention prior to reading, but 
  154. they need not be in this format as written by the gateway.
  155.  
  156. *Outgoing mail path:  The name of the directory in which Pmail 
  157. should create outgoing mail messages. Again, command substitution 
  158. (described above) can be used in this string for specialised 
  159. processing.
  160.  
  161. *Run for outgoing mail:  If you enter a program name in this 
  162. field,  Pmail will run it every time it sends new mail to the 
  163. gateway. The program must leave  the screen in the condition 
  164. it found it (ie, if it writes to the screen, it must do so using 
  165. non-destructive windows). This field is the one which will normally 
  166. benefit the most from the use of command substitution (see above). 
  167. By embedding escape keys in this string, you can construct extremely 
  168. complex command lines. Usually, this field will refer to a "glue" 
  169. program you have written to interface with the gateway: the actual 
  170. invocation of the gateway is intended to be user-activated via 
  171. choices in the SENDER.PM file.
  172.  
  173. *Filename format:  This field allows you some control over the 
  174. filenames Pmail will use when creating outgoing messages. The 
  175. ~d command substitution (random integer value) is often very 
  176. useful in this field.
  177.  
  178. Run to validate address:  You can provide a program which Pmail 
  179. will call to validate that an address is correct. If you do so, 
  180. enter it in this field. Unlike other command strings, command 
  181. substitution is not possible with this field  the only parameter 
  182. passed on the  command line is the address to validate. Your 
  183. program must not disturb the screen, and must return 0 if the 
  184. address is invalid, or non-zero if the address is OK.  If nothing 
  185. is entered in this field, no attempt will be made to validate 
  186. addresses.
  187.  
  188. *Reply address format:  This field allows you control how Pmail 
  189. will construct the "From" address in outgoing messages. You can 
  190. use command substitution in this field.  
  191.  
  192.    Example: entering ~8@home.otago.ac.nz (~p)
  193.    will cause the from field of messages from user david to read 
  194.    david@home.otago.ac.nz (David Harris).
  195.  
  196. Accepts SMTP addresses:  If your gateway accepts messages using 
  197. standard internet address formats, set this flag to 'Y'. If Charon 
  198. is not installed on your system and a user enters a standard 
  199. internet address, Pmail will examine all available gateways, 
  200. and will pass the message to the first with this flag set. This 
  201. allows users to send internet mail using normal addressing, rather 
  202. than having to send it specifically via a gateway using the SERVER/ADDRESS 
  203. format.
  204.  
  205. Simple message headers:  Pmail can write messages with extra 
  206. preparsed address information at the beginning of the message. 
  207. This information is line-based, using line number as a key. Gateways 
  208. which read simple message headers must read until a totally blank 
  209. line is encountered, then send the remainder of the message, 
  210. which will be normally formatted. At present, two lines are defined 
  211. in the simple headers, although others will certainly be added:
  212.  
  213. *    Line 1: The recipient of this message (not the same as the 
  214. To: field)
  215.  
  216. *    Line 2: Contains 'Y' if this message has attachments.
  217.  
  218. Lines without values will contain a single space. Addresses are 
  219. already parsed. Since the format is intended to be extensible, 
  220. gateways which understand simple headers must ignore lines they 
  221. are not written to use, and must read until the blank line.
  222.  
  223. UUencode attachments:  If 'Y', then Pmail will generate a separate 
  224. message for each attachment, and will uuencode the attachment 
  225. into the message. If 'N', a file with the same name as the message 
  226. but the extension '.ATT' will be written into the outgoing mail 
  227. directory, along with the attachments. The .ATT file will contain 
  228. the names of the attachments to the message, one per line.
  229.  
  230.    (Pmail 2.2 (R4) and (R5) ONLY support uuencoded attachments).
  231.  
  232. Burst messages?  If 'Y', then Pmail will create one message for 
  233. every address sent to: it is up to your gateway process to use 
  234. the ~t command substitution to ensure that delivery is correct, 
  235. since you generally will not be able to tell from the message's 
  236. headers who a particular copy should be sent to. If 'N', Pmail 
  237. assumes that your gateway can parse the message for address information, 
  238. and will write all the addresses into one message, using standard 
  239. RFC-822 folding and header rules. The exception to this is messages 
  240. with a BCC header: this will generate two envelopes, one with 
  241. the BCC field, the other without. Your process can determine 
  242. which is the BCC delivery using the ~q command substitution.
  243.  
  244. Check new mail every X seconds:  [Only applies to gateways where 
  245. "New mail path" is not a program]  specifies how often Pmail 
  246. should check the New mail path for new mail. This value is a 
  247. minimum length of time - Pmail may check less frequently than 
  248. the value specified, but will never check more frequently.
  249.  
  250.  
  251. Gateways and BCC:
  252. ----------------
  253.  
  254. Messages with BCC (Blind Carbon Copy) recipients present special 
  255. problems to gateways, since the same message ends up being processed 
  256. twice - once with no BCC header, then again as a separate job 
  257. containing the BCC header. Pmail can indicate to the gateway 
  258. process that a message needs BCC processing (using the ~q command 
  259. substitution), but it is up to the gateway process to ensure 
  260. that the BCC field is properly handled, and that the message 
  261. is correctly forwarded. If your gateway does not handle BCC as 
  262. a special case, we recommend that you do NOT use BCC fields.
  263.  
  264.  
  265. SENDER.PM - Altering the Main menu
  266. ----------------------------------
  267.  
  268. Pegasus Mail v2.25 and later allow you to add sub-choices to 
  269. two of the options on the main menu- "Check for New mail" and 
  270. "Send a mail message". The addition is done via a text file called 
  271. SENDER.PM, which must be stored in the same directory as PMAIL.EXE. 
  272. This file contains sets of 5 lines, each set defining one sub-choice. 
  273. Blank lines and lines beginning with a semi-colon (';') are treated 
  274. as comments and are ignored. The lines within each set have the 
  275. following meanings:
  276.  
  277. *    Line 1: Either N if this entry is to be added to the New Mail 
  278. submenu, or S if it is for the Send message submenu.
  279.  
  280. *    Line 2: The text to show in the submenu
  281.  
  282. *    Line 3: Pegasus Mail will create a temporary filename which 
  283. can be passed to the command you specify on the command line. 
  284. If this field is Y, then Pmail will look for the file when the 
  285. command returns: if the file exists and is longer than 0 bytes, 
  286. Pmail will parse it as a message and mail it normally. This allows 
  287. you to create alternative message entry screens. Note that if 
  288. you use this option, the file must contain a properly-formatted 
  289. RFC-822 message on return. Attachments cannot currently be specified 
  290. in this file.
  291.  
  292. *    Line 4: Enter Y on this line if Pmail should save its screen 
  293. before invoking the command, and restore it when the command 
  294. returns. If N, then Pmail assumes that the command either does 
  295. no screen output, or that it does it non-destructively.
  296.  
  297. *    Line 5: Enter the command Pmail should invoke on this line. 
  298. All command substitutions (see above) are possible here. The 
  299. maximum length of an entry on this line is 80 characters, although 
  300. the command line may be up to 128 characters in length after 
  301. command substitution. To invoke the usual built-in function (ie, 
  302. either Check for New Mail or Send a Message), enter a single 
  303. colon (':') on this line. The command you enter here may be an 
  304. MS-DOS batch file or an executable image.
  305.  
  306.  
  307. A Sample Implementation - Pmail and Waffle.
  308. -------------------------------------------
  309.  
  310. Waffle is a particularly good Bulletin-Board System which is 
  311. widely distributed as Shareware on the Internet and on numerous 
  312. public services. Among its features is a solid implementation 
  313. of uucico, the UNIX copy-in - copy-out routine used to make uucp 
  314. transfers. Remember that Waffle is a Shareware program: we urge 
  315. you to send in the shareware license for Waffle if you use any 
  316. part of it - the program is well worth it, and the author deserves 
  317. support.
  318.  
  319. Pmail can be quite easily interfaced with Waffle, providing a 
  320. quite functional standalone mail facility via uucp. One small 
  321. "glue" program is required - the source for this is included 
  322. on the Pmail distribution diskette as an example of how gateways 
  323. can be implemented. The glue program was written by Brendan Murray, 
  324. Systems Manager at the University of Otago. Brendan has kindly 
  325. made the source freely available and modifiable without charge 
  326. or restriction. Both the glue code and this example assume that 
  327. you have a properly-configured copy of Waffle on your system.
  328.  
  329. Essentially, Pmail creates a temporary file, then passes it to 
  330. the glue program, using a number of command substitutions to 
  331. minimise the parsing the program has to do. The glue code then 
  332. parses Waffle's static configuration file and creates appropriate 
  333. mail files in the right place for uucico and uuxqt. Two options 
  334. are added to the main menu to allow the user to choose when to 
  335. invoke uucico to process outgoing mail, and receive incoming 
  336. mail.
  337.  
  338. A sample user-defined gateway definition for Waffle is as follows:
  339.  
  340. Gateway name:              WAFFLE
  341. New mail path:             c:\mailbox\~8
  342. Is ^ a program to run?:    N
  343. New mail search mask:      ~8.*
  344. Outgoing mail path:        c:\scratch\tmp
  345. Run for outgoing mail:     c:\bin\filter ~n ~c ~t ~y
  346. Filename format:           ~d~d.WOM
  347. Run to validate address:    
  348. Reply address format:      ~8@myhost.domain
  349. Accepts SMTP addresses?:   Y
  350. Simple message headers?:   N
  351. UUencode attachments?:     Y
  352. Burst messages?:           Y
  353. Strip GW name?:            Y
  354. Check new mail every x seconds.
  355.  
  356.  
  357. Brendan's filter program locates Waffle's configuration file 
  358. using the WAFFLE environment variable; it expects parameters 
  359. on the command-line in the following order:
  360.  
  361.    1:    The name of the user sending the message
  362.    2:    The name of the message container file
  363.    3:    The To: field of the message
  364.    4:    The time and date as an RFC-822 string
  365.  
  366.  
  367.  
  368. The SENDER.PM file for Pmail using Waffle is as follows:
  369.  
  370. S
  371. Regular mail message
  372. N
  373. N
  374. :
  375.  
  376. S
  377. Send all outgoing mail
  378. N
  379. Y
  380. uucico
  381.  
  382. N
  383. Read new mail messages
  384. N
  385. N
  386. :
  387.  
  388. N
  389. Check host for new mail
  390. N
  391. Y
  392. uucico
  393.  
  394.